package com.kabigon.tiny.config;

import com.alibaba.fastjson.JSONObject;
import com.kabigon.tiny.log.event.SysLogListener;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author xu.biao
 * @version v1.0
 * @Package com.kabigon.tiny.config
 * @data 2023-07-28 1:46
 */
@Slf4j
@Configuration
public class SysLogListenerConfig{

    @Bean
    public SysLogListener sysLogListener() {
        return new SysLogListener(dto -> {
            log.info(JSONObject.toJSONString(dto));
        });
    }

}
